package com.pipe.controller;

import com.pipe.service.OssService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName OssController
 * @Author HETAO
 * @Date 2020/7/10 15:11
 */
@RestController
@RequestMapping("oss")
@CrossOrigin
@Api("云存储OSS")
public class OssController {

    @Autowired
    private OssService ossService;

    @PostMapping("/upload")
    @ApiOperation("上传图片")
    public String uploadImage(MultipartFile file) {
        return ossService.uploadByOss(file);
    }
}
